<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page language="java" pageEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%@ include file="../../common/common.jsp" %>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>角色列表 - ${title }</title>
</head>
<link href="${ctx }/static/plugins/zTree_v3/css/zTreeStyle.css" rel="stylesheet"/>
<body
        <%@ include file="../../common/skin.jsp" %>
>
<%@ include file="../../common/head.jsp" %>
<%@ include file="../../common/menu.jsp" %>
<div class="J_content">
    <div class="mt20 plr20">
        <form action="${ctx }/information/personnelInformation" id="queryForm" method="POST">
            <div class="J_toolsBar clearfix">
                <div class="t_text ml10">
                    <input placeholder="请输入职位名称" type="text" name="jobName"
                           value="${resumeQueryDTO.jobName }" style="border-radius: 6px"/>
                </div>
                <select name="createDate" class="t_text ml10" style="border-radius: 6px">
                    <option value="-1" selected>-时间↑↓-</option>
                    <option value="desc" <c:if test="${resumeQueryDTO.sortNum == 'desc'}">selected</c:if>>时间↑</option>
                    <option value="asc" <c:if test="${resumeQueryDTO.sortNum == 'asc'}">selected</c:if>>时间↓</option>
                </select>
                <div class="t_button mgl30">
                    <a class="abtn red" href="javascript:myQuery();">
                        <i class="icon"></i>查询
                    </a>
                </div>
                <div class="t_label ml10">
                    记录数：<label style="color: red;" id="total">${page.totalCount }</label>
                </div>
            </div>
            <div class="J_table mt20">
                <div class="t_table">
                    <table>
                        <thead>
                        <tr>
                            <td>
                                <span>序号</span>
                            </td>
                            <td>
                                <span>职位类别</span>
                            </td>
                            <td>
                                <span>省市区</span>
                            </td>
                            <td>
                                <span>姓名</span>
                            </td>
                            <td>
                                <span>性别</span>
                            </td>
                            <td>
                                <span>籍贯</span>
                            </td>
                            <td>
                                <span>工作经验</span>
                            </td>
                            <td>
                                <span>最高学历</span>
                            </td>
                            <td>
                                <span>创建时间</span>
                            </td>
                            <td>
                                <span>联系电话</span>
                            </td>
                            <td>
                                <span>简历状态</span>
                            </td>
                            <td>
                                <span>操作</span>
                            </td>
                        </tr>
                        </thead>
                        <tbody>
                        <c:choose>
                            <c:when test="${page.list != null && page.totalCount > 0 }">
                                <c:forEach items="${page.list }" var="r" varStatus="status">
                                    <tr>
                                        <td class="first">
                                            <div class="t_text tc">
                                                    ${status.index+1 }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${r.columnInfo.name}
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${r.provinces }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${r.name }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${r.gender == '0' ? "男" : "女"}
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${r.nativePlace }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${r.workExperience }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${r.educationBackground }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                <fmt:formatDate value="${r.createDate }" pattern="yyyy-MM-dd HH:mm:ss"/>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${r.phone }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${r.resumeShow == 0 ? "公开" : "隐藏" }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_link">
                                                <a href="javascript:myEdit('${r.id }');"><i class="icon"></i>查看详情</a>
                                            </div>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                                <tr>
                                    <td colspan="6">
                                        <div class="J_null mt40">
                                            <img src="${ctx }/static/images/null.png">
                                            <p>暂无相关数据</p>
                                        </div>
                                    </td>
                                </tr>
                            </c:otherwise>
                        </c:choose>
                        </tbody>
                    </table>
                </div>
                <%@ include file="../../common/pager.jsp" %>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript" src="${ctx }/static/plugins/zTree_v3/js/jquery.ztree.all.min.js"></script>
<script type="text/javascript">
    <%--跳转页面到编辑页--%>
    function myEdit(id) {
        var loadIdx = layer.load();
        $.post('${ctx}/information/personnelInformation/edit?id=' + id, {}, function (str) {
            layer.close(loadIdx);
            layer.open({
                title: "详情预览",
                type: 1,
                area: ['600px', '600px'],
                content: str,
                btn: ['确定', '取消'],
                yes: function (index, layero) {
                    mySubmit();
                },
                btn2: function (index, layero) {
                    layer.close(index);
                }
            });
        });
    }
    function mySubmit() {
        $('#editForm').submit();
    }
    function myQuery() {
        $('#queryForm').submit();
    }

</script>
</body>
</html>